
<?php

// This file is part of the Carrington Text Theme for WordPress
// http://carringtontheme.com
//
// Copyright (c) 2008-2009 Crowd Favorite, Ltd. All rights reserved.
// http://crowdfavorite.com
//
// Released under the GPL license
// http://www.opensource.org/licenses/gpl-license.php
//
// **********************************************************************
// This program is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
// **********************************************************************

if (__FILE__ == $_SERVER['SCRIPT_FILENAME']) { die(); }
if (CFCT_DEBUG) { cfct_banner(__FILE__); }

    $current_category = get_query_var('cat');
  	$year ='&year=2011';
  	if(isset($_GET['postyear'])){
    	$year = '&year='.intval($_GET['postyear']);
  	}
	 //query_posts('category_name=mediacenter&showposts=30&year=2011');
	query_posts('cat='.$current_category . $year.'&showposts=5');
	 
	 while (have_posts()) : the_post();
		$category = get_the_category($post->ID);
		$categoryName = $category[1]->cat_name;
		
		if($categoryName == 'mediacenter')
		{
			$categoryName = $category[0]->cat_name;
		}
	?>
	
		<article class='highlight'>
				<h3><?php echo $categoryName; ?></h3>
				
				<a class='thumb' href='<?php the_permalink(); ?>'>
				 
			<?php 
			$photos = aldenta_get_images_url('full');
			if ($photos) 
			{
				?>
					<img class='thumb' src="<?php echo $photos[0]; ?>"> 
				<?php
			}else{
				?>
					<img src="<? bloginfo('template_url');?>/img/placeholder.jpg"> 
			<?php
			}
			 ?>

			<?php the_title();?>
			</a>
			<img class='light' src="<? bloginfo('template_url');?>/img/light.png">
		</article>

	<?php endwhile; ?>
      


			    		  		





